﻿<%@ Page Title="Connect lists" Language="C#" MasterPageFile="~/Demo.master" Inherits="DemoPage"
    StylesheetTheme="start" %>

<%@ Register Src="~/CodeFormatter.ascx" TagName="Code" TagPrefix="demo" %>

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        DataBind();
    }
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="DemoHolder" runat="Server">
    <div class="dna-state-help ui-corner-all" style="margin-bottom: 10px;">
        Sort items from one SimpleListView Control (using DataBound in this sample) into another and vice versa, by passing a server side selector into
        the <b>ConnectWith</b> property. The simplest way to do this is to group all related lists
        with a CSS class, and then pass that class into the sortable function (i.e., connectWith:
        '.myclass').
    </div>
    <br />
    <style type="text/css">
        .sortable1, .sortable2 { list-style-type: none; margin: 5px; padding: 0; padding-top: 3px;float: left; }
        .sortable1 li, .sortable2 li { width: 120px;margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 9pt; height: 18px;  }
        .sortable1 li span, .sortable2 li span { position: absolute; margin-left: -1.3em; }
    </style>
    <DotNetAge:SimpleListView ID="SimpleListView1" runat="server" CssClass="connectedSortable ui-helper-reset ui-widget-content sortable1 ui-corner-all"
        ItemCssClass="ui-helper-reset ui-state-default ui-corner-all" DataSourceID="XmlSortableListDataSource">
        <ItemTemplate>
            <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
            <%# Eval("Text") %>
        </ItemTemplate>
    </DotNetAge:SimpleListView>
    <DotNetAge:SimpleListView ID="SimpleListView2" runat="server" CssClass="connectedSortable ui-helper-reset ui-widget-content sortable2 ui-corner-all"
        ItemCssClass="ui-helper-reset ui-state-highlight ui-corner-all" DataSourceID="XmlSortableListDataSource">
        <ItemTemplate>
            <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
            <%# Eval("Text") %>
        </ItemTemplate>
    </DotNetAge:SimpleListView>
    <DotNetAge:Sortable ID="Sortable1" runat="server">
        <Target TargetIDs="SimpleListView1,SimpleListView2" />
        <ConnectWith Selector=".connectedSortable" />
    </DotNetAge:Sortable>
    <asp:XmlDataSource ID="XmlSortableListDataSource" runat="server" DataFile="~/Sortable/sortable.xml"
        XPath="items/item"></asp:XmlDataSource>
    <div style="clear: left; margin-top: 5px;">
    </div>
    <br />
    <demo:Code runat="server" ID="codeView" SourceFile="~/Sortable/Codes/ConnectLists.aspx" />
</asp:Content>
